close all
clear all
clc
% row
% str=inputdlg('Input constraints number', 'Input dialog') 
% constraints=str2num(str{1})
%
% column
% str2=inputdlg('Input colum number', 'Input dialog')
% variables=str2num(str2{1})

constraints=3;
variables=3;

% uicontrol('style', 'edit', 'position', [20 50 50 30]);
% uicontrol('style', 'edit', 'position', [20 50 50 30]);

f = figure('Position', [80 80 800 600], 'Menubar', 'none', 'Name', 'FYP GUI', 'Color', 'white')
uP = uipanel('FontSize',12,...
    'BackgroundColor','white',...
    'Position',[.02 .02 .96 .80]);

p1=75;
p2=180 + (50*constraints);
p3=10;
p4=20;

% x1, x2...xn
for i=1:1:variables
    uicontrol('Parent',uP,'style', 'text', 'position', [p1 p2 p3 p4], 'String', 'x', 'fontSize', 14);
    uicontrol('Parent',uP,'style', 'text', 'position', [p1+10 p2-7 p3 p4], 'String', i, 'fontSize', 10);
    p1=p1+80;
end

p1=100;
p2=250 + (50*constraints);
p3=40;
p4=30;

% Objective
for i=1:1:variables
    uicontrol('Parent',f,'style', 'edit', 'position', [p1 p2 p3 p4]); 
%     uicontrol('Parent',f,'style', 'edit', 'position', [.90 .98 .40 .30]);
    p1=p1+80;
end


p1=80;
p2=200;

for i=1:1:variables
    for j=1:1:constraints
        uicontrol('style', 'edit', 'position', [p1 p2 p3 p4]);
        p2=p2+50;
    end
    p2=200;
    p1=p1+80;
end

p2=200;
for i=1:1:constraints
    uicontrol('style', 'popup', 'position', [p1 p2 p3 p4], 'String', '>=|<=|=', 'fontSize', 10);
    p2=p2+50;    
end

p1=p1+80;
p2=200;
for i=1:1:constraints
    uicontrol('style', 'edit', 'position', [p1 p2 p3 p4]);
    p2=p2+50;
end



% --- Executes on button press in okButton.
function okButton_Callback(hObject, eventdata, handles)
% hObject    handle to okButton (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
